# -*- coding: utf-8 -*-
"""
@Time ： 2022/12/29 21:42
@Author ： PJC
"""
from common.logger import logger


# @logger
def assert_api(actual_data, expect_data):
    # Logger.info("*************** {}开始执行用例 ***************".format(expect_data['info']))
    try:
        a = expect_data
        b = actual_data
        for i, j in a.items():
            if i in b.keys():
                assert j == b[i]
        for i in a.keys():
            if i == 'data':
                a = a['data']
                if i in b.keys():
                    assert a == b[i]
    except AssertionError as e:
        # Logger.error('=====>{}用例执行未通过'.format(expect_data['info']))
        # 将异常抛出
        raise e
